package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:53:49
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductModelActionBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductModelActionDAO.Id);

        mappedDaoFields.put("objectId",
            com.ourteam.product.model.dao.IProductModelActionDAO.ObjectId);

        mappedDaoFields.put("propertyId",
            com.ourteam.product.model.dao.IProductModelActionDAO.PropertyId);

        mappedDaoFields.put("action",
            com.ourteam.product.model.dao.IProductModelActionDAO.Action);

        mappedDaoFields.put("operation",
            com.ourteam.product.model.dao.IProductModelActionDAO.Operation);

        mappedDaoFields.put("propertyValue",
            com.ourteam.product.model.dao.IProductModelActionDAO.PropertyValue);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductModelActionDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductModelActionDAO.Remarks);

        mappedDaoFields.put("propertyName",
            com.ourteam.product.model.dao.IProductModelActionDAO.PropertyName);

        mappedDaoFields.put("propertyDataType",
            com.ourteam.product.model.dao.IProductModelActionDAO.PropertyDataType);
    }

    private com.ourteam.product.model.dao.ProductModelAction productModelAction;

    public ProductModelActionBean() {
        super();

        this.productModelAction = new com.ourteam.product.model.dao.ProductModelAction();
    }

    public ProductModelActionBean(
        com.ourteam.product.model.dao.ProductModelAction productModelAction) {
        super();

        this.productModelAction = productModelAction;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productModelAction);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductModelAction convertToProductModelAction() {
        return this.productModelAction;
    }

    public com.ourteam.product.model.dao.ProductModelAction convertTo() {
        return this.productModelAction;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productModelAction.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productModelAction.setId(id);
    }

    /**
     * Get objectId
     *
     * @return long
     */
    public long getObjectId() {
        return (long) this.productModelAction.getObjectId();
    }

    /**
     * Set objectId
     *
     * @parameter long
     */
    public void setObjectId(long objectId) {
        this.productModelAction.setObjectId(objectId);
    }

    /**
     * Get propertyId
     *
     * @return long
     */
    public long getPropertyId() {
        return (long) this.productModelAction.getPropertyId();
    }

    /**
     * Set propertyId
     *
     * @parameter long
     */
    public void setPropertyId(long propertyId) {
        this.productModelAction.setPropertyId(propertyId);
    }

    /**
     * Get action
     *
     * @return String
     */
    public String getAction() {
        return (String) this.productModelAction.getAction();
    }

    /**
     * Set action
     *
     * @parameter String
     */
    public void setAction(String action) {
        this.productModelAction.setAction(action);
    }

    /**
     * Get operation
     *
     * @return String
     */
    public String getOperation() {
        return (String) this.productModelAction.getOperation();
    }

    /**
     * Set operation
     *
     * @parameter String
     */
    public void setOperation(String operation) {
        this.productModelAction.setOperation(operation);
    }

    /**
     * Get propertyValue
     *
     * @return String
     */
    public String getPropertyValue() {
        return (String) this.productModelAction.getPropertyValue();
    }

    /**
     * Set propertyValue
     *
     * @parameter String
     */
    public void setPropertyValue(String propertyValue) {
        this.productModelAction.setPropertyValue(propertyValue);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productModelAction.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productModelAction.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productModelAction.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productModelAction.setRemarks(remarks);
    }

    /**
     * Get propertyName
     *
     * @return String
     */
    public String getPropertyName() {
        return (String) this.productModelAction.getPropertyName();
    }

    /**
     * Get propertyDataType
     *
     * @return String
     */
    public String getPropertyDataType() {
        return (String) this.productModelAction.getPropertyDataType();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductModelActionBean) == false) {
            return false;
        } // end if

        ProductModelActionBean other = (ProductModelActionBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductModelAction tempProductModelAction = other.convertToProductModelAction();

        if ((tempProductModelAction == null) ||
                (this.productModelAction == null)) {
            isEqual = false;
        } else if ((tempProductModelAction == this.productModelAction) ||
                tempProductModelAction.equals(this.productModelAction)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductModelActionBean[] toArray(
        com.ourteam.product.model.dao.ProductModelAction[] aProductModelActions) {
        return toArray(aProductModelActions, null);
    }

    public static ProductModelActionBean[] toArray(
        com.ourteam.product.model.dao.ProductModelAction[] aProductModelActions,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductModelActions)) {
            return new ProductModelActionBean[0];
        }

        int length = aProductModelActions.length;

        ProductModelActionBean[] beans = new ProductModelActionBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductModelActionBean(aProductModelActions[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductModelActions[i] });
            }
        }

        return beans;
    }
}
